#ifndef CAR_H
#define CAR_H

#include <QObject>
#include <QWidget>
#include <QLabel>
#include <QPainter>
#include <QPointF>
#include <QPixmap>
#include <QMatrix>
#include "qcustomplot.h"
#define CAR_VIEW_SIZE 50

class Car : public QLabel
{
public:
    Car(QCustomPlot *_plot, QWidget *parent = 0);
    void setPos(QPointF, int ang);//设置坐标
    void setPos();
    QPointF getPos();
    void setPixPos(QPoint, int ang);//设置小车的屏幕像素坐标
    void setPixPos(QPoint _pos);//设置小车的屏幕像素坐标
    void setAngle(int ang);//设置小车的朝向角度,正北为0度
    void setCarView(bool);//true:小车视角  false:全局视角
    void updatePos(QPointF _pos);

public slots:
    void updatePosition();
private:
    QPointF pos;
    int angle;
    QMatrix matrix;
    QPixmap pixCar;
    QCustomPlot* plot;

};

#endif // CAR_H
